package com.gongJiao.Vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 分页返回结果对象
 * @author Administrator
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
    private Integer code;
    private String message;
    /**
     * 总记录数
     */
    private Integer count;
    /**
     * 所有数据
     */
    private List<T> data;

    public PageResult<T> success(List<T> data, Integer count){
        return new PageResult<T>(0,"成功", count, data);
    }

}
